package 力扣日常刷题.木22二月.第21天227;

/**
 * @author 帅小伙
 * @date 2022/2/27
 * @description
 */
public class Demo170 {
    public int prefixCount(String[] words, String pref) {
        int n = pref.length();
        int ans = 0;
        for (String word : words) {
            if(word.length() < n) continue;
            if(word.substring(0,n).equals(pref))ans++;
        }
        return ans;
    }
}
